package routers

import (
	"blog/controllers/api"
	"blog/controllers/backend"
	"github.com/astaxie/beego"
)

func init() {

	beego.Router("/", &backend.HomeController{}, "get:Index")

	//后台api
	backendApiRouter :=
		beego.NewNamespace("/api",
			beego.NSAutoRouter(&api.AdminController{}),
			//beego.NSRouter("/welcome", &backend.HomeController{}, "get:Welcome"),
			//beego.NSRouter("/admin/change-password", &backend.AdminController{}, "get:ChangePassword"),
			//beego.NSRouter("/admin/change-role", &backend.AdminController{}, "get:ChangeRole"),
			//beego.NSAutoRouter(&backend.BlogController{}),
			//beego.NSAutoRouter(&backend.CategoryController{}),
			//beego.NSAutoRouter(&backend.MenuController{}),
			//beego.NSAutoRouter(&backend.RoleController{}),
			//beego.NSAutoRouter(&backend.TestController{}),
			//beego.NSAutoRouter(&backend.AdminController{}),
		)

	//后台api
	//backendApiRouter :=
	//	beego.NewNamespace("/admin/api",
	//		beego.NSAutoRouter(&api2.CategoryController{}),
	//		beego.NSAutoRouter(&api2.BlogController{}),
	//		beego.NSAutoRouter(&api2.MenuController{}),
	//		beego.NSAutoRouter(&api2.RoleController{}),
	//		beego.NSAutoRouter(&api2.AdminController{}),
	//		beego.NSRouter("/menu/get-menu-list", &api2.MenuController{}, "get:GetMenuList"),
	//		beego.NSRouter("/admin/change-password", &api2.AdminController{}, "post:ChangePassword"),
	//		beego.NSRouter("/admin/change-role", &api2.AdminController{}, "post:ChangeRole"),
	//	)

	// api
	//apiRouter :=
	//	beego.NewNamespace("api",
	//		beego.NSRouter("/upload-image", &api.UploadController{}, "post:UploadMdImage"),
	//	)
	//ns :=
	//	beego.NewNamespace("/api",
	//		beego.NSRouter("/pneumonia", &api.PneumoniaController{}, "get:List"),
	//		beego.NSRouter("/province", &api.PneumoniaController{}, "get:GetProvinceData"),
	//
	//		beego.NSRouter("/new-blog", &api.BlogController{}, "post:NewBlog"),
	//		beego.NSRouter("/get-blog-list", &api.BlogController{}, "get:GetBlogList"),
	//		beego.NSRouter("/get-category-list", &api.BlogController{}, "get:GetCategoryList"),
	//		beego.NSRouter("/upload-image", &api.UploadController{}, "post:UploadMdImage"),
	//		beego.NSRouter("/upload-image-with-sign", &api.UploadController{}, "post:UploadImageWithSign"),
	//		beego.NSRouter("/get-server-date", &api.CommonController{}, "get:GetServerDate"),
	//		beego.NSRouter("/blog-view", &api.BlogController{}, "get:BlogView"),
	//	)

	//注册 namespace
	beego.AddNamespace(backendApiRouter)
}
